
# hash map demo
my_dict = {}
my_dict['apple'] = 10
my_dict['banana'] = 20
my_dict['orange'] = 30

# 遍历字典
for key, value in my_dict.items():
    print(f"{key}: {value}")
# 遍历所有的 key
for key in my_dict.keys():
    print(f"key: {key}")
# 遍历所有的 value
for value in my_dict.values():
    print(f"value: {value}")

# 删除一个元素
del my_dict['banana']
print(my_dict)

# get the size of the dictionary
print(f"Size of the dictionary: {len(my_dict)}")

# clear the dictionary
my_dict.clear()
print(my_dict)